package com.project.daojishi;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

public class MyPageAdapter extends FragmentPagerAdapter {

    private String[] title = new String[]{"日历","倒计时"};

    public MyPageAdapter(FragmentManager manager){
        super(manager);
    }
    @Override
    public Fragment getItem(int position) {
        if(position==0){
            return new FirstFragment();
        }else{
            return new SecondFragment();
        }


    }

    @Nullable
    @Override
        public CharSequence getPageTitle(int position) {
       return title[position];
    }

    @Override
    public int getCount() {
        return 2;
    }
}
